define(["jquery","bbcare","as/app/dst/dstHistoryRecord.servers","as/app/dst/dstHistoryRecord.ui","as/app/dst/dstHistoryRecord.event"],
	function($,$bb,$servers,$ui,$event){
	var dstHistoryRecord = {};

	/**
	 * 查询用户评估信息成功后的回调函数
	 */
	var ajaxRecordlistCallBack = function(data,params){
		$ui.historyList({
			"id":"historyList",
			"list":data.rows,
		});
		$("#historyList li").unbind("click");
		$("#historyList li").data("info",params);
		$("#historyList li").click($event.onHistorySelect);
		var index = $servers.getRecordIndex(data.rows,params);
		$("#historyList li").eq(index).click();
	}

	dstHistoryRecord.init = function(){
		var params = $bb.getPageParams();
		// $(".dstDetail-wrap").parents(".assess-wrap").length 判断是从患者中心打开 还是从dst菜单打开
		if( $(".dstHistoryRecord-wrap").parents(".assess-wrap").length > 0 ){
			$("#dstHistoryRecordList").hide();
			$(".dstHistoryRecord-wrap > div:nth-child(1)").css({"width":"100%"});
		}
		$servers.ajaxRecordlist(params,ajaxRecordlistCallBack);
	}

	return dstHistoryRecord;
});